package com.cyf.utils.sunpos;

public class SolPosTest {
    public static void main(String[] args) {
        SolPosTest solPosTest = new SolPosTest();
        solPosTest.init();
    }

    private void init(){
        PosData pdat = new PosData();
        pdat.longitude = -80.84;  /* Note that latitude and longitude are  */
        pdat.latitude  =  35.23;  /*   in DECIMAL DEGREES, not Deg/Min/Sec */
        pdat.timezone  =  -5.0;   /* Eastern time zone, even though longitude would
                                  suggest Central.  We use what they use.
                                  DO NOT ADJUST FOR DAYLIGHT SAVINGS TIME. */

        pdat.year      = 2020;    /* The year is 1999. */
        pdat.daynum    =  63;    /* July 22nd, the 203'rd day of the year (the
                                  algorithm will compensate for leap year, so
                                  you just count days). S_solpos can be
                                  configured to accept month-day dates; see
                                  examples below.) */

    /* The time of day (STANDARD time) is 9:45:37 */

        pdat.hour      =  8;
        pdat.minute    = 15;
        pdat.second    = 0;



        SolPos solPos=new SolPos();

    /* I use Atlanta, GA for this example */

    /* Finally, we will assume that you have a flat surface facing southeast,
       tilted at latitude. */

        //   pdat->tilt      = pdat->latitude;  /* Tilted at latitude */

        solPos.S_solpos (pdat);  /* S_solpos function call */

        System.out.println(String.format ( "SOLTEST -> %d,%d,%d, daynum %d, retval %d\n",
                pdat.year, pdat.month, pdat.day, pdat.daynum, 1));
        System.out.println(String.format ( "SOLTEST -> azim %f, elevref %f\n",
                pdat.azim,   pdat.elevref ));

    }
}
